home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1988 February
/
Ahoy_Magazine_88-02_1988_Double_L.d64
/
Screen Wizardry
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
4KB
|
114 lines
10 rem downward vertical scrolling
20 printchr$(8)chr$(142)
30 poke53281,.:poke53280,.:print"[147]score 0000 alien hellspawn ships [218][218][218]"
40 poke646,rnd(1)*16:print"";tab(rnd(1)*40);chr$(46+(rnd(.)>.9)*-163)
50 poke218,peek(218)or128
60 print"[157]";chr$(148)
70 geta$:ifa$=""then40
80 rem scrolling color bars
90 b$="":forx=.to39:b$=b$+chr$(32):next
100 print"[147]"tab(11)"color bar scrolling"
110 print""tab(14)"[164][175][162][185][162][184][184][146][162][184][146][185][175][185][164]"
120 printtab(10)"[164][185][162][183] [183][184][184][146][185][164]"
130 printtab(6)"[164][175][162][183] [183][146][162][164]"
140 printtab(5)"[169] [223]"
150 printtab(4)"[169] [170]"
160 printtab(4)"[165] "
170 printtab(4)" [146][169]"
180 printtab(4)"[223] [175][162][146][183]"
190 printtab(5)"[163][183][184][162][146][184][162][146][184][162][185][164] [164][162][146][183][184][183]"
200 printtab(16)"[223] [146][169]"
210 printtab(17)" [146][181]"
220 print" [176][176][176][176][146]"spc(12)" [146][161] [172][172][172][146] [176][176]"
230 print" [176][176][176][176][146] [187][187][187][146] :::[146] [161] [146][165] [172][172][172][146] [176][176][176][176][146] [176][176]"
240 print" [176][176][176][176][146] [187][187][187][146] :::[146] [170] [146][161] [176][176][146] [172][172][172][146] [176][176][176][176][146] [176][176]"
250 print" [176][176][176][176][146] [187][187][187][146] :::[146] [146][165] [176][176][146] [172][172][172][146] [176][176][176][176][146] [176][176]"
260 print"[162][176][176][176][176][146][162][187][187][187][146][162]:::[146][185][162][164][169] {$7f}[146][164][176][176][184][172][172][172][146][185][176][176][176][176][163][176][176][146][185]";
270 print" future's so bright i gotta wear shades "
280 printtab(11)"press space to exit":poke198,.
290 rem point screen editor to harmless
300 rem ram location (192*256=49152)
310 poke648,192:print
320 printmid$("[150][129][158]",(rnd(1)*5)+1,1):printb$
330 geta$:ifa$<>" "then320
340 poke648,4:print
350 rem move screen lines
360 print"[147]"tab(10)"moving screen lines"
370 forx=.to20:poke646,rnd(1)*15+1:forj=.to4:printspc(3)""x;:nextj:print:nextx
380 printspc(6)"[146]press m to move line,x to exit"
390 geta$:ifa$<>"m"then430
400 ifa$="m"thent=(rnd(1)*21)+1:f=(rnd(1)*21)+1
410 poke781,t:sys59888:poke172,peek(60656+f):poke780,peek(216+f)
420 poke783,.:sys59848:print""
430 ifa$<>"x"then390
440 poke53248+21,1:poke2040,13:poke53248,170:poke53249,180:poke53248+16,.
450 poke53248+39,1
460 print"[147]type in any character :";
470 geta$:ifa$=""ora$<"a"ora$>"z"then470
480 printa$
490 print"i'm creating a string 63 characters longto use as a sprite shape."
500 s$="":forx=.to63:s$=s$+a$:next:print"s$="chr$(34)s$chr$(34):print
510 print"now we print this string to the sprite's";
520 print"block at 828,sprite block 13":print
530 print"poke648,3:printchr$(19)chr$(17)spc(20);s$:poke648,4":print
540 print"press key for another character,ctrl-x to exit shape demo"
550 gosub580
560 poke198,.:wait198,1:geta$:ifa$=""thenpoke53248+21,.:goto600
570 goto460
580 poke648,3:printchr$(19)chr$(17)spc(20);s$:poke648,4:return
590 rem horizontal rough scrolling
600 print"[147]"tab(5)"simple horizontal scrolling"
610 printtab(6)"cursor keys left <-> right"
620 printtab(7)"x to exit scrolling demo"
630 poke214,21:print:printtab(15)"stand by!":forx=.to39:print"[184]";:next:print"[151]";
640 rem scroll data in four strings
650 dim l$(39),m$(39,3),s$(3)
660 s$(.)=" [176][174] [176][174] [176][174] "
670 s$(1)=" [176][178][174] [213][201] [171][179] [176][174] [171][179] [176][174] [171][179] "
680 s$(2)=" [171][219][179] [171][179] [171][179] [213][201] [171][179] [171][179][176][174] [176][189][194][176][174] [171][179] "
690 s$(3)="[176][174][171][219][219][178][178][174][171][179][176][174][171][219][174][176][174][171][179][176][174][171][179][176][189][173][189][173][195][195][189] [173][177][177][178][195][177][177][195]"
700 forj=.to3:forx=.to39:m$(x,j)=right$(s$(j),39-x)+left$(s$(j),x):nextx,j
710 forx=.to39:forj=.to3:l$(x)=l$(x)+m$(x,j)+" ":nextj,x
720 x=.:poke198,.
730 poke214,18:print
740 printl$(x);:forj=.to50:next
750 geta$:ifa$=""then750
760 ifa$="[157]"thenx=x+1+(x=39)*40
770 ifa$=""thenx=x-1+(x=.)*-40
780 ifa$="x"then810
790 goto730
800 rem scrolling diagonal lines
810 poke53281,5:poke53280,13:print"[147]everybody play football!"
820 print"press space to run a touchdown!":poke198,.:wait198,1
830 forx=.to500:print"[205]";:next
840 rem clear screen lines
850 poke53281,.:poke53280,.
860 print"[147]"tab(10)"clearing screen lines"
870 forx=.to20:poke646,rnd(1)*15+1:printb$;:next
880 printspc(5)"[146]press c to clear line,x to exit"
890 geta$:ifa$="c"thenpoke781,(rnd(1)*21)+1:poke783,.:sys59903
900 ifa$<>"x"then890
910 rem curtain effect using delete chr$
920 poke53281,.:poke53280,6:print""
930 print"[147]":fori=.to22:forx=.to37:print"[194]";:next:print:next
940 print"press shift to open curtain"
950 poke214,10:print:printtab(10)"curtain opening":wait653,1
960 fori=.to39:print"";:forj=.to23:print""chr$(20):nextj,i
970 rem random mapping
980 poke53281,6:poke53280,.:print"[147]"chr$(14)tab(14)"[155][205]ap [195]reator"
990 printtab(7)"[154][208]ress [193] [203]ey [212]o [195]reate [205]ap":poke198,.:wait198,1:print"[147]"
1000 rem experiment with different seed
1010 rem values for the random function
1020 rem to change map layout
1030 x=rnd(-2.1)
1040 print"[149]";:a$="[166]":poke214,10:print:printtab(20);:forx=.to999:gosub1100:next
1050 print"";:a$="[255]":forx=.to100:gosub1100:next
1060 print"[153]";:a$="[169]":forx=.to300:gosub1100:next
1070 print"[144]";:a$="[223]":forx=.to300:gosub1100:next
1080 poke214,22:print:printtab(12)"[204]and of [193]dventure";:goto1130
1090 rem draw terrain subroutine
1100 printa$;mid$("[145][157]",rnd(.5)*4+1,1);"[157]";
1110 ifpeek(214)>22thenprint"[145]";
1120 return
1130 poke198,.:wait198,1:printchr$(9)